Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
Is there a way to "pass" the user.name of auth0 user to a async function?

I'm creating a next.js app which reads a custom post type from a wordpress multisite. I want when a user sign-in (using auth0), the name of the user to go in the wordpress URL to replace the "site" name.

For example: I have this code in utils/wordpress.js

const BASE_URL = "https://fsm.xristosavgeros.com/sitename/wp-json/wp/v2/work";

export async function getPosts() {
  const postsRes = await fetch(BASE_URL + "?_embed");
  const posts = await postsRes.json();
  const filterPosts = posts.filter((post) => post.assigned_to == 'Johnny Worker');
  return filterPosts;
  }

What I need is something like this:

const BASE_URL = "https://fsm.xristosavgeros.com/ + user.name + /wp-json/wp/v2/work";

I think the way to go is useUser() hook but no matter where i tried to use it, the app crashes.

Any ideas?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda